<?php
/*
  Llamadas ajax para obtener el portfolio
  @author: bmagario
*/
  include_once("../common.php");
  include_once("../modules/modulePortfolio.php");

  //datos a obtener cuando se realiza la llamada por ajax
  $data_angular = file_get_contents("php://input");
  $data_angular_decode = json_decode($data_angular);
  if ($data_angular_decode->action) { //si el parametro action fue establecido.
    $action = $data_angular_decode->action;
    switch($action) { 
      case "portfolio": getPortfolio(); break;
    }
  }


  function getPortfolio(){
    //ejemplo proyecto
    $project1 = array(
          "name" => "Shortkeys for Chrome",
          "thumb" => "cabin.png",
          "description" => "A Chrome extension for custom keyboard shortcuts. Angular powers the admin/options UI",
          "url" => "https =>//chrome.google.com/webstore/detail/logpjaacgmcbpdkdchjiaagddngobkck",
          "src" => "https =>//github.com/mikecrittenden/chrome-shortkeys",
          "submitter" => "mikecrittenden",
          "submissionDate" => "2012-06-21",
          "tags" => array(
            "Chrome",
            "Extension",
            "Open Source",
            "Local Storage",
            "JSON"
          )
    );

    $data = array(
      "data" => array(
        "projects" => array(
          $project1,
          $project1,
          $project1,
          $project1
        )
      )
    );

    echo json_encode($data);  
  }

?>

